package net.xiduth.game.player.content.randomevents;

import java.util.TimerTask;

import net.xiduth.Settings;
import net.xiduth.cores.CoresManager;
import net.xiduth.game.World;
import net.xiduth.game.WorldTile;
import net.xiduth.game.player.Player;

@SuppressWarnings("unused")
public class GoblinRaids {
	
	private transient Player player;
 	
	public static void startRaid() {
	CoresManager.fastExecutor.schedule(new TimerTask() {
			int timer = 7400;
			
			@Override
			public void run() {
				if (timer == 1) {
					Settings.GOBLINRAID = true;
					for (Player players: World.getPlayers()) {
					    if (players == null) continue;
					    players.getPackets().sendGameMessage("<img=7><col=FF0000>News: Goblins have raided the home area!", false);
				/**
				 * Raid Spawning
				 */
				World.spawnNPC(3264, new WorldTile(3695, 2967, 0), -1, true, true); 
				World.spawnNPC(3264, new WorldTile(3696, 2963, 0), -1, true, true);
				World.spawnNPC(3264, new WorldTile(3692, 2968, 0), -1, true, true);
				World.spawnNPC(3264, new WorldTile(3692, 2965, 0), -1, true, true);
				}
			}
				if (timer > 0) {
					Settings.GOBLINRAID = false;
					timer--;
				}
			}
		}, 0L, 1000L);
	}
}